package cn.iocoder.yudao.module.infra.api.face.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 人脸操作响应 VO
 *
 * @author 芋道源码
 */
@Schema(description = "管理后台 - 人脸操作响应 VO")
@Data
public class FaceOperationRespVO {

    @Schema(description = "操作是否成功", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
    private Boolean success;

    @Schema(description = "错误信息", example = "人脸注册失败")
    private String errorMessage;

    @Schema(description = "错误代码", example = "1001011002")
    private Integer errorCode;

    @Schema(description = "处理时间（毫秒）", example = "1500")
    private Long processTime;

    @Schema(description = "用户ID", example = "user123")
    private String userId;

    @Schema(description = "人脸Token", example = "bdabba7b6faf5c96353f012cabfe6de6")
    private String faceToken;

    @Schema(description = "相似度分数", example = "0.95")
    private Double score;

    @Schema(description = "人脸数量", example = "1")
    private Integer faceCount;

    @Schema(description = "原始响应数据")
    private String rawData;

    /**
     * 创建成功响应
     */
    public static FaceOperationRespVO success() {
        FaceOperationRespVO resp = new FaceOperationRespVO();
        resp.setSuccess(true);
        return resp;
    }

    /**
     * 创建失败响应
     */
    public static FaceOperationRespVO error(String errorMessage) {
        FaceOperationRespVO resp = new FaceOperationRespVO();
        resp.setSuccess(false);
        resp.setErrorMessage(errorMessage);
        return resp;
    }

    /**
     * 创建失败响应
     */
    public static FaceOperationRespVO error(Integer errorCode, String errorMessage) {
        FaceOperationRespVO resp = new FaceOperationRespVO();
        resp.setSuccess(false);
        resp.setErrorCode(errorCode);
        resp.setErrorMessage(errorMessage);
        return resp;
    }
}